package com.gaobug.platform.controller;

import com.gaobug.base.response.ResponseWrapped;
import com.gaobug.platform.service.CaptchaService;
import com.gaobug.verify.Verify;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 博客分类接口
 */
@RestController
@RequestMapping("/captcha")
public class CaptchaController {
    @Resource
    private CaptchaService captchaService;

    /**
     * 发送邮箱验证码
     */
    @GetMapping("/email")
    public ResponseWrapped<Object> send(@Verify(required = true) String email) {
        captchaService.sendEmail(email);
        return ResponseWrapped.success();
    }

}
